package it.crosato.stage.server.model.actions;

import static org.junit.Assert.*;

import java.util.Vector;

import it.crosato.stage.shared.objects.Comparison;
import it.crosato.stage.shared.objects.EntityDefinition;
import it.crosato.stage.shared.objects.SelectionLists;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ActionsTest {

	@Test
	public void testGetLists() {
		long time = new Long(604800000);
		SelectionLists lists = new Actions().getLists(time);
		assertTrue(lists != null);
		assertTrue(lists.getOrganisms() != null);
		assertTrue(lists.getPathways() != null);
	}

	@Test
	public void testCompare() {
		Vector<EntityDefinition> selectedOrganisms = new Vector<EntityDefinition>();
		selectedOrganisms.add(new EntityDefinition("Homo sapiens (human)","hsa"));
		Vector<EntityDefinition> selectedPathways = new Vector<EntityDefinition>();
		selectedOrganisms.add(new EntityDefinition("Citrate cycle (TCA cycle)","path:map00020"));
		Comparison comparison = new Actions().compare(selectedOrganisms, selectedPathways,
				true, true, 50, 604800000, "sid", System.getProperty("user.home") + "/");
		assertTrue(comparison.getPathways().length > 0);
	}
	
	@Before
	public void setUp() {
		
	}
	
	@After
	public void tearDown() {
		
	}

}
